package learn_concurrent._12;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class T2 {
	public static void main(String[] args) {
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");

		for (int i = 0; i < 10; i++) {
			new Thread(() -> {
				synchronized (sdf) {
					try {
						Date date = sdf.parse("1951-04-21");
						System.out.println(date);
					} catch (ParseException e) {
						e.printStackTrace();
					}
				}
			}).start();
		}
	}
}
